package com.eveinfo.api.character.skilltraining;

import java.util.Calendar;
import java.util.Date;

import com.eveinfo.api.ApiResponse;

public class ApiSkillTraining extends ApiResponse {

	private static final long serialVersionUID = -602406652242207349L;
	private Date trainingEndTime;
	private Date trainingStartTime;
	private int trainingTypeID;
	private int trainingStartSP;
	private int trainingDestinationSP;
	private int trainingToLevel;
	private boolean skillInTraining;

	public Date getTrainingEndDate(){
		return trainingEndTime;
	}

	public void setTrainingEndTime(Date trainingEndTime) {
		this.trainingEndTime = trainingEndTime;
	}

	public Date getTrainingStartDate(){
		return trainingStartTime;
	}

	public void setTrainingStartTime(Date trainingStartTime) {
		this.trainingStartTime = trainingStartTime;
	}

	public int getTrainingTypeID() {
		return trainingTypeID;
	}

	public void setTrainingTypeID(int trainingTypeID) {
		this.trainingTypeID = trainingTypeID;
	}

	public int getTrainingStartSP() {
		return trainingStartSP;
	}

	public void setTrainingStartSP(int trainingStartSP) {
		this.trainingStartSP = trainingStartSP;
	}

	public int getTrainingDestinationSP() {
		return trainingDestinationSP;
	}

	public void setTrainingDestinationSP(int trainingDestinationSP) {
		this.trainingDestinationSP = trainingDestinationSP;
	}

	public int getTrainingToLevel() {
		return trainingToLevel;
	}

	public void setTrainingToLevel(int trainingToLevel) {
		this.trainingToLevel = trainingToLevel;
	}

	public boolean isSkillInTraining() {
		return skillInTraining;
	}

	public void setSkillInTraining(boolean skillInTraining) {
		this.skillInTraining = skillInTraining;
	}

	public long getRemainTime(){
		long endTime = getTrainingEndDate().getTime();
		long currentTime = getCurrentTime().getTime();
		long cacheTime = Calendar.getInstance().getTime().getTime() - getCurrentTime().getTime(); 
		return endTime - currentTime - cacheTime;
	}

}
